﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage.master" Theme="SkinFile"
AutoEventWireup="true" Inherits="Nivdal.ComparePlayers" Codebehind="ComparePlayers.aspx.cs" %>

<asp:Content ID="Content1" ContentPlaceHolderID="HeadPlaceHolder" Runat="Server">
    <script type="text/ecmascript" language="javascript">
        function HideColumn(num) {
            rows = document.getElementById("ctl00_ctl00_ContentPlaceHolder3_ContentPlaceHolder1_CompareGridview").rows;
            for (i = 0; i < rows.length; i++) {
                rows[i].cells[num].style.display = 'none';
            }
        }
        function HideRow(CompareId) {
            rows = document.getElementById("ctl00_ctl00_ContentPlaceHolder3_ContentPlaceHolder1_CompareGridview").rows;
            var RowCompareId;
            var ElementId;
            alert(CompareId);
            for (i = 1; i < rows.length; i++) {
                ElementId = "ctl00_ctl00_ContentPlaceHolder3_ContentPlaceHolder1_CompareGridview_ctl0" + (i + 1) + "_CompareIdHiddenField";
                alert(ElementId);
                RowCompareId = document.getElementById(ElementId).value;
                alert(RowCompareId);
                if (RowCompareId == CompareId)
                    rows[i].style.display = 'none';
            }
        }
        
        function ShowNormalColumn(num) {
            rows = document.getElementById("ctl00_ctl00_ContentPlaceHolder3_ContentPlaceHolder1_CompareGridview").rows;
            for (i = 0; i < rows.length; i++) {
                rows[i].cells[num].style.display = 'block';
            }
        }
        function ShowBoldColumn(num) {
            rows = document.getElementById("ctl00_ctl00_ContentPlaceHolder3_ContentPlaceHolder1_CompareGridview").rows;
            for (i = 0; i < rows.length; i++) {
                rows[i].cells[num].style.display = 'block';                
            }
        }
        
        function ShowRegulars()
        {
            ShowNormalColumn(2);
            ShowNormalColumn(3);
            ShowNormalColumn(4);
            ShowNormalColumn(5);
            ShowNormalColumn(6);
            
            document.getElementById("ctl00_ctl00_ContentPlaceHolder3_ContentPlaceHolder1_HideRegularsButton").style.display = 'block';
            document.getElementById("ctl00_ctl00_ContentPlaceHolder3_ContentPlaceHolder1_ShowRegularsButton").style.display = 'none';
        } 
        
        function HideRegulars()
        {
            HideColumn(2);
            HideColumn(3);
            HideColumn(4);
            HideColumn(5);
            HideColumn(6);
            
            document.getElementById("ctl00_ctl00_ContentPlaceHolder3_ContentPlaceHolder1_HideRegularsButton").style.display = 'none';
            document.getElementById("ctl00_ctl00_ContentPlaceHolder3_ContentPlaceHolder1_ShowRegularsButton").style.display = 'block';
        }
               

        function ShowDefenceOnly() {  
            ShowNormalColumn(7);
            HideColumn(8);
            ShowBoldColumn(9);
            ShowBoldColumn(10);
            ShowBoldColumn(11);
            ShowNormalColumn(12);
            ShowNormalColumn(13);
            HideColumn(14);
            HideColumn(15);
            ShowNormalColumn(16);
            HideColumn(17);
        }
        
        function ShowMidOnly(){
            ShowNormalColumn(7);
            HideColumn(8);
            ShowNormalColumn(9);
            HideColumn(10);
            HideColumn(11);
            HideColumn(12);
            ShowNormalColumn(13);
            ShowBoldColumn(14);
            ShowBoldColumn(15);
            ShowBoldColumn(16);
            HideColumn(17);
        }

        function ShowWingOnly() {
            ShowNormalColumn(7);
            HideColumn(8);
            ShowNormalColumn(9);
            HideColumn(10);
            HideColumn(11);
            HideColumn(12);
            ShowBoldColumn(13);
            ShowBoldColumn(14);
            ShowBoldColumn(15);
            ShowBoldColumn(16);
            HideColumn(17);
        }

        function ShowKeeperOnly() {
            ShowBoldColumn(7);
            ShowBoldColumn(8);
            ShowNormalColumn(9);
            HideColumn(10);
            HideColumn(11);
            HideColumn(12);
            HideColumn(13);
            HideColumn(14);
            HideColumn(15);
            ShowNormalColumn(16);
            HideColumn(17);
        }

        function ShowForwardOnly() {
            ShowNormalColumn(7);
            HideColumn(8);
            ShowNormalColumn(9);
            HideColumn(10);
            HideColumn(11);
            ShowBoldColumn(12);
            ShowNormalColumn(13);
            ShowBoldColumn(14);
            ShowNormalColumn(15);
            HideColumn(16);
            ShowBoldColumn(17);
            
            
        }  
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <div class="basic_element">
    <div class="red_title">
       <asp:Label ID="ComparedPlayersTitleLabel" runat="server" CssClass="white_title" Text="<%$ Resources:Resource, ComparePlayers_ComparedPlayersTitleLabelText %>"></asp:Label>
    </div>
    <div class="padding5">
        <asp:HiddenField ID="Selected" runat="server" />
        <br />
        <asp:GridView ID="CompareGridview" runat="server" AllowPaging="false" AllowSorting="false" AutoGenerateColumns="false"
         SkinID="SimpleProfessional" DataSourceID="PlayerCompareDataSourse">
            <EmptyDataTemplate>
                <asp:Label ID="NothingToCompareLabel" runat="server" SkinID="GridLabel"
                 Text="<%$ Resources:Resource, ComparePlayers_NoPlayersSelectedLabelText %>"></asp:Label>
             
            </EmptyDataTemplate>
            <Columns>
                <asp:TemplateField> 
                    <HeaderTemplate>
                        <asp:Label ID="PlayerTitleLabel" runat="server" style="cursor:pointer;" 
                        Text="<%$ Resources:Resource, Global_Player %>"></asp:Label>
                    </HeaderTemplate>
                    <ItemTemplate>                                       
                        <asp:HyperLink ID="PlayerHyperlink" runat="server" SkinID="GreenTitleHyperLink"
                         NavigateUrl='<%# "~/Player.aspx?Id=" + Eval("PlayerId") %>'
                         Text='<%# Eval("PlayerName") %>'></asp:HyperLink>                       
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField>
                    <HeaderTemplate>
                        <asp:Label ID="FitnessHeaderLabel" runat="server"  style="cursor:pointer;"
                         Text="<%$ Resources:Resource, Global_FitnessHeader %>"
                         ToolTip="<%$ Resources:Resource, Global_Fitness %>"></asp:Label>
                    </HeaderTemplate>
                    <ItemTemplate>
                        <asp:Label ID="FitnessLabel" runat="server" Text='<%# Eval("Fitness") %>' SkinID="GridLabel" ToolTip="<%$ Resources:Resource, Global_Fitness %>" />
                    </ItemTemplate>                
                </asp:TemplateField>
                <asp:TemplateField>
                    <HeaderTemplate>
                        <asp:Label ID="CharismaHeaderLabel" runat="server" style="cursor:pointer;"
                         Text="<%$ Resources:Resource, Global_CharismaTitleLabel %>"
                         ToolTip="<%$ Resources:Resource, Global_Charisma %>"></asp:Label>
                    </HeaderTemplate>
                    <ItemTemplate>
                        <asp:Label ID="CharismaLabel" runat="server" Text='<%# Eval("Charisma") %>' SkinID="GridLabel" 
                        ToolTip="<%$ Resources:Resource, Global_Charisma %>" />
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField>
                    <HeaderTemplate>
                        <asp:Label ID="ExperienceHeaderLabel" runat="server"  style="cursor:pointer;"
                        ToolTip="<%$ Resources:Resource, Global_Experience%>"
                        Text="<%$ Resources:Resource, Global_ExperienceHeader %>"></asp:Label>
                    </HeaderTemplate>
                    <ItemTemplate>
                        <asp:Label ID="ExperienceLabel" runat="server" Text='<%# Eval("Experience") %>' SkinID="GridLabel"
                         ToolTip="<%$ Resources:Resource, Global_Experience%>"></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField>
                    <HeaderTemplate>
                        <asp:Label ID="StrongFootHeaderLabel" runat="server"  style="cursor:pointer;"
                        Text="<%$ Resources:Resource, Global_StrongFootHeader%>"  
                        ToolTip="<%$ Resources:Resource, Global_StrongFoot %>"></asp:Label>
                    </HeaderTemplate>
                    <ItemTemplate>
                        <asp:Label ID="StrongFootLabel" runat="server" Text='<%# Eval("StrongFootShort") %>' SkinID="GridLabel" 
                        ToolTip='<%# Resources.Resource.Global_StrongFoot.ToString() + ": " + Eval("StrongFoot") %>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField>
                    <HeaderTemplate>
                        <asp:Label ID="StaminaHeaderLabel" runat="server" style="cursor:pointer;"
                         Text="<%$ Resources:Resource, Global_StaminaHeader %>" 
                        ToolTip="<%$ Resources:Resource, Global_Stamina %>"></asp:Label>
                    </HeaderTemplate>
                    <ItemTemplate>
                        <asp:Label ID="StaminaLabel" runat="server" Text='<%# Eval("Stamina") %>' 
                        SkinID="GridLabel" ToolTip="<%$ Resources:Resource, Global_Stamina %>" />
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField>
                    <HeaderTemplate>
                        <asp:Label ID="InstinctsHeaderLabel" runat="server"  style="cursor:pointer;"
                        Text="<%$ Resources:Resource, Global_InstinctsHeader %>"  
                        ToolTip="<%$ Resources:Resource, Global_Instincts %>"></asp:Label>
                    </HeaderTemplate>
                    <ItemTemplate>
                        <asp:Label ID="InstinctsLabel" runat="server" Text='<%# Eval("Instincts") %>'
                         ToolTip="<%$ Resources:Resource, Global_Instincts %>" SkinID="GridLabel"></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField>
                    <HeaderTemplate>
                        <asp:Label ID="GoalKeepingHeaderLabel" runat="server" style="cursor:pointer;" 
                        Text="<%$ Resources:Resource, Global_GoalKeepingHeader %>"  
                        ToolTip="<%$ Resources:Resource, Global_GoalKeeping %>"></asp:Label>
                    </HeaderTemplate>
                    <ItemTemplate>
                        <asp:Label ID="GoalKeepingLabel" runat="server" Text='<%# Eval("GoalKeeping") %>'
                        ToolTip="<%$ Resources:Resource, Global_GoalKeeping %>" SkinID="GridLabel"></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField>
                    <HeaderTemplate>
                        <asp:Label ID="PositioningHeaderLabel" runat="server" style="cursor:pointer;"
                        Text="<%$ Resources:Resource, TeamListOfPlayers_PositioningHeaderLabel %>" 
                        ToolTip="<%$ Resources:Resource, Global_Positioning %>"></asp:Label>
                    </HeaderTemplate>
                    <ItemTemplate>
                        <asp:Label ID="PositioningLabel" runat="server" Text='<%# Eval("Positioning") %>'
                        ToolTip="<%$ Resources:Resource, Global_Positioning %>" SkinID="GridLabel"></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField>
                    <HeaderTemplate>
                        <asp:Label ID="PowerHeaderLabel" runat="server"  style="cursor:pointer;"
                        Text="<%$ Resources:Resource, TeamListOfPlayers_PowerHeaderLabel %>" 
                        ToolTip="<%$ Resources:Resource, Global_Power %>"></asp:Label>
                    </HeaderTemplate>
                    <ItemTemplate>
                        <asp:Label ID="PowerLabel" runat="server" Text='<%# Eval("Power") %>' 
                        SkinID="GridLabel" 
                        ToolTip="<%$ Resources:Resource, Global_Power %>" />
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField>
                    <HeaderTemplate>
                        <asp:Label ID="TacklingHeaderLabel" runat="server" style="cursor:pointer;" 
                        Text="<%$ Resources:Resource, Global_TacklingHeader %>" 
                        ToolTip="<%$ Resources:Resource, Global_Tackling %>"></asp:Label>
                    </HeaderTemplate>
                    <ItemTemplate>
                        <asp:Label ID="TacklingLabel" runat="server" 
                        Text='<%# Eval("Tackling") %>' SkinID="GridLabel" 
                        ToolTip="<%$ Resources:Resource, Global_Tackling %>" />
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField>
                    <HeaderTemplate>
                        <asp:Label ID="HeadingHeaderLabel" runat="server"  style="cursor:pointer;"
                        Text="<%$ Resources:Resource, Global_HeadersTitleAbbreviation %>"  
                        ToolTip="<%$ Resources:Resource, Global_Heading %>"></asp:Label>
                    </HeaderTemplate>
                    <ItemTemplate>
                        <asp:Label ID="HeadingLabel" runat="server" Text='<%# Eval("Heading") %>' 
                        SkinID="GridLabel" ToolTip="<%$ Resources:Resource, Global_Heading %>" />
                    </ItemTemplate>
                </asp:TemplateField>     
              <asp:TemplateField>
                    <HeaderTemplate>
                        <asp:Label ID="QuicknessHeaderLabel" runat="server"  style="cursor:pointer;"
                        Text="<%$ Resources:Resource, TeamListOfPlayers_QuicknessHeaderLabel %>"  
                        ToolTip="<%$ Resources:Resource, Global_Quickness %>"></asp:Label>
                    </HeaderTemplate>
                    <ItemTemplate>
                        <asp:Label ID="QuicknessLabel" runat="server" Text='<%# Eval("Quickness") %>' 
                        SkinID="GridLabel"
                         ToolTip="<%$ Resources:Resource, Global_Quickness %>" />
                    </ItemTemplate>
               </asp:TemplateField>
               <asp:TemplateField>
                    <HeaderTemplate>
                        <asp:Label ID="TechniqueHeaderLabel" runat="server"  style="cursor:pointer;"
                        Text="<%$ Resources:Resource, Global_TechniqueHeader %>" 
                        ToolTip="<%$ Resources:Resource, Global_Technique %>"></asp:Label>
                    </HeaderTemplate>
                    <ItemTemplate>
                        <asp:Label ID="TechniqueLabel" runat="server" Text='<%# Eval("Technique") %>' 
                        SkinID="GridLabel" ToolTip="<%$ Resources:Resource, Global_Technique %>"  />
                    </ItemTemplate>
                </asp:TemplateField>       
               <asp:TemplateField>
                    <HeaderTemplate>
                        <asp:Label ID="ShortPassingHeaderLabel" runat="server"  style="cursor:pointer;"
                        Text="<%$ Resources:Resource, Global_ShortPassingHeader %>" 
                        ToolTip="<%$ Resources:Resource, Global_ShortPassing %>"></asp:Label>
                    </HeaderTemplate>
                    <ItemTemplate>
                        <asp:Label ID="ShortPassingLabel" runat="server" Text='<%# Eval("ShortPassing") %>' 
                        SkinID="GridLabel" ToolTip="<%$ Resources:Resource, Global_ShortPassing %>" />
                    </ItemTemplate>
                </asp:TemplateField>                   
               <asp:TemplateField>
                    <HeaderTemplate>
                        <asp:Label ID="LongPassingHeaderLabel" runat="server"  style="cursor:pointer;"
                        Text="<%$ Resources:Resource, Global_LongPassingHeader %>"  
                        ToolTip="<%$ Resources:Resource, Global_LongPassing %>"></asp:Label>
                    </HeaderTemplate>
                    <ItemTemplate>
                        <asp:Label ID="LongPassingLabel" runat="server" Text='<%# Eval("LongPassing") %>' 
                        SkinID="GridLabel" ToolTip="<%$ Resources:Resource, Global_LongPassing %>" />
                    </ItemTemplate>
                </asp:TemplateField>           
               <asp:TemplateField>
                    <HeaderTemplate>
                        <asp:Label ID="ShootingHeaderLabel" runat="server" style="cursor:pointer;"
                         Text="<%$ Resources:Resource, TeamListOfPlayers_ShootingLabel %>" 
                         ToolTip="<%$ Resources:Resource, Global_Shooting %>" ></asp:Label>
                    </HeaderTemplate>
                    <ItemTemplate>
                        <asp:Label ID="ShootingLabel" runat="server" Text='<%# Eval("Shooting") %>' 
                        SkinID="GridLabel" ToolTip="<%$ Resources:Resource, Global_Shooting %>" />
                    </ItemTemplate>
                </asp:TemplateField>    
    <%--            <asp:TemplateField>
                    <HeaderTemplate>
                        <asp:Label ID="SumTitleLabel" runat="server" Text="<%$ Resources:Resource, ComparePlayers_SumHeaderTitleLabel %>"
                         ToolTip="<%$ Resources:Resource, ComparePlayers_SumHeaderToolTip %>"></asp:Label>
                    </HeaderTemplate>
                    <ItemTemplate>
                        <asp:Label ID="SumLabel" runat="server" ToolTip="<%$ Resources:Resource, ComparePlayers_SumHeaderToolTip %>"
                        Text='<%# int.Parse(Eval("Instincts").ToString()) + 
                                  int.Parse(Eval("Goalkeeping").ToString()) +
                                  int.Parse(Eval("Positioning").ToString()) +
                                  int.Parse(Eval("Stamina").ToString()) +
                                  int.Parse(Eval("Power").ToString()) +
                                  int.Parse(Eval("Tackling").ToString()) +
                                  int.Parse(Eval("Heading").ToString()) +
                                  int.Parse(Eval("Quickness").ToString()) +
                                  int.Parse(Eval("Technique").ToString()) +
                                  int.Parse(Eval("LongPassing").ToString()) +
                                  int.Parse(Eval("Shooting").ToString()) %>'
                         SkinID="GridLabel"></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField> --%>                                         
            </Columns>
        </asp:GridView>
    </div>
    </div>
    <%--    <br />
    <asp:Button ID="ShowDefenceButton" runat="server" Text="<%$ Resources:Resource, ComparePlayers_ShowDefenceButtonText %>"
     OnClientClick="javascript:ShowDefenceOnly(); return(false);" CssClass="GreenSmallButtonStyle"/>
     <br />
    <asp:Button ID="ShowRegularsButton" runat="server" Text="<%$ Resources:Resource, ComparePlayers_ShowRegularsButtonText %>" 
     OnClientClick="javascript:ShowRegulars(); return(false);" style="display:none;" CssClass="GreenSmallButtonStyle"/>
     <asp:Button ID="HideRegularsButton" runat="server" Text="<%$ Resources:Resource, ComparePlayers_HideRegularsButtonText %>" 
     OnClientClick="javascript:HideRegulars(); return(false);" CssClass="GreenSmallButtonStyle"/>
    <br />--%>
    <%--<asp:Button ID="DeleteSelectedButton" runat="server" CssClass="GreenSmallButtonStyle"
    OnClick="DeleteSelected" Text="<%$ Resources:Resource, InternalTeamMessages_DeleteSelectedButtonText %>" />--%>
     
     <asp:SqlDataSource ID="PlayerCompareDataSourse" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
        SelectCommand="Nivdal_GetPlayerCompareData" SelectCommandType="StoredProcedure">
    </asp:SqlDataSource>

</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="PageNamePlaceHolder" Runat="Server">
        <asp:Label ID="PageLabel" runat="server" CssClass="PageNameContentStyle"
     Text="<%$ Resources:Resource, ComparePlayers_PageName %>"></asp:Label>
</asp:Content>

